import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    userId: null,
    nickname: null,
    headImg: null,
    playUrl: null,
    isPlay: null,
    playTime:0
  },
  mutations: {
    setData(state, data) {
      state.userId = data.userId
      state.nickname = data.nickname
      state.headImg = data.avatarUrl
    },
    changUrl(state, data) {
      state.playUrl=data
    },
    changPlay(state, data) {
      state.isPlay=data
    },
    changTime(state, data) {
      state.playTime = data
    }
  },
  actions: {
  },
  modules: {
  }
})
